package com.whnk.common.pm.enums;

/**
 * 个人考勤类型
 * 
 * @author whnk
 */
public enum PmEmpSignType
{
	
	WORK_NORMAL("0", "正常"), WORK_OVERTIME("1", "工作日加班"), WORK_EVECTION("2", "出差"), WEEKEND_OVERTIME("3", "周末加班"), 
	HOLIDAY_OVERTIME("4", "假日加班"), FESTIVAL_OVERTIME("5", "节日加班"), WORK_ABSENCE("6", "缺勤"), WORK_LEAVE("7", "请假");

    private final String code;
    private final String info;

    PmEmpSignType(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }
    
    /**
     * 根据code获取info的值
     * 
     * @param code
     * @return
     */
    public static String getValueByKey(String code){
        for (PmEmpSignType s : PmEmpSignType.values()) {
            if(s.getCode().equals(code)){
                return s.getInfo();
            }
        }
        return "";
    }
    
}
